package com.jsh.config.exception;


import com.jsh.common.api.response.ResultCode;

/**
 * @Author JiangYaoFeng
 * 2021/5/27 5:14
 */

public class ExceptionCast {

    public static void cast(ResultCode resultCode){
        throw new CustomException(resultCode);
    }
    public static void cast(boolean success, Integer code,String message){
        throw new CustomException(new ResultCode() {
            @Override
            public boolean success() {
                return success;
            }

            @Override
            public int code() {
                return code;
            }

            @Override
            public String message() {
                return message;
            }
        });
    }

}
